package com.zichuan.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * @author zichuan
 * @version 1.0
 * @Package : com.zichuan.config
 * @Description : TODO
 * @Create on : 2025/2/18 15:15
 */
@Slf4j
@Component
public class MyReturnCallBack implements RabbitTemplate.ReturnsCallback {

    @Override
    public void returnedMessage(ReturnedMessage returnedMessage) {
        log.error("消息没有从交换机正确路由到队列，原因为:{}",returnedMessage.getMessage());
    }
}
